import request from '@/router/axios'
import {getLineName, getQianxiangType, getStationName, qianxiangType,fenExYuangettoFixed} from "../commonCheck";
import store from '@/store';
export const tableOption = {
  menu:false,
  border: true,
  index: true,
  emptyBtn:false,
  indexLabel: '序号',
  stripe: true,
  menuAlign: 'center',
  viewBtn: true,
  editBtn: false,
  delBtn: false,
  align: 'center',
  addBtn: false,
  selection: true,
  reserveSelection:true,
  height: 500,
  searchLabelWidth:100,
  column: [ {
    // hide: true,
    width: 100,
    label: '线路',
    prop: 'lineCode',
    type: 'select',
    search: true,
    filterable : true,
    cascaderItem: ["stationCode"],
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getLineLists?userCode="+ store.getters.userInfo.userCode,
    formatter: function(row, value , label, column){
      return getLineName(value);
    },
    // display: true // 动态显隐控制不能删除
  }, {
    // hide: true,
    width: 180,
    label: '站点',
    prop: 'stationCode',
    type: 'select',
    search: true,
    filterable : true,
    dicFlag: false,
    props: {
      label: 'name',
      value: 'code'
    },
    dicUrl: "/check/check/getStationLists?userCode="+ store.getters.userInfo.userCode + "&lineCode={{key}}",
    formatter: function(row, value , label, column){
      return getStationName(row.lineCode,value);
    },
    // display: true ,// 动态显隐控制不能删除
  }, {
    width: 100,
    label: 'TVM编号',
    prop: 'tvmCode',
    type: 'input',
    hide: false,
    search: false
  },/* {
    label: '钱箱编号',
    prop: 'moneyBoxCode',
    search: false,
    hide: false,
  }, */{
    width: 120,
    hide: false,
    label: '钱箱类型',
    prop: 'moneyBoxType',
    formatter :function(row, value , label, column){

      return value;
    },
    type:'select',
    dicData: qianxiangType(),
    search: true,
  }, {
    // hide: true,
    label: '未卸载日期',
    width: 100,
    prop: 'uninstalledDate',
    type: 'date',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    search: true
  },{
    // hide: true,
    width: 100,
    label: '卸载日期',
    prop: 'uninstallDate',
    type: 'date',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',	
    search:true
  }, {
    hide: false,
    label: '卸载金额',
    prop: 'uninstallAmount',
    formatter:function(row, value , label, column){
      return value.toFixed(2);
    },
    search: false
  }, {
    hide: false,
    label: '应卸载金额',
    prop: 'shouldBeUnloadedAmount',  
    formatter:function(row, value , label, column){
      return value.toFixed(2);
    },
    search: false
  }, {
    hide: false,
    label: '差异金额',
    prop: 'differenceAmount',   
    formatter:function(row, value , label, column){
      return value.toFixed(2);
    },
    search: false
  }, {
    hide: false,
    label: '卸载人',
    prop: 'checkPersonName',
    search: false
  }, {
    width: 90,
    hide: false,
    label: '卸载人工号',
    prop: 'inventoryPersonJobNo',
    search: false
  }, {
    hide: false,
    width: 90,
    label: '入账日期',
    prop: 'postDate',
    type: 'date',
    format: 'yyyy-MM-dd',
    valueFormat: 'yyyy-MM-dd',
    search: false,
    editDisplay: false,
    addDisplay: false
  }, {
    width: 130,
    label: '备注',
    prop: 'remark',
    editDisplay: false,
    search: false,
    addDisplay: false
  }]
}
export function getCashboxUninstallList(param) {
  return request({
    url: '/check/check/getCashboxUninstallList',
    method: 'post',
    params: param
  })
}

export function highDelCashBox(query) {
  return request({
    url: '/check/check/highDelCashBox',
    method: 'post',
    params: query
  })
}

export function setCashboxUninstallPostDate(param) {
  return request({
    url: '/check/check/setCashboxUninstallPostDate',
    method: 'post',
    data:param,
    params:param
  })
}
